﻿using System.Collections;
using System.Collections.Generic;
using System.Linq;

namespace Xc.DataAccess.Protocoals.WaterMeters.Models.Requests
{
    /// <summary>
    /// 修改上报周期和超时限制
    /// </summary>
    public class SetMeterUploadIntervalRequest : MeterFrameTxBase
    {
        internal protected override DataSegment DataSegment => DataSegment.SetMeterUploadInterval;

       internal protected override FrameCommand Cmd => FrameCommand.CMD06;

        protected override void GetDataArea(List<byte> vs)
        {
            vs.Add(CsqLimit);
            vs.Add(ReceiveTimeout);
            vs.Add(SendTimeout);
            vs.Add(RetryCount);
            vs.Add((byte)NetworkEnableFlag);
            vs.Add(UploadMinute);
            vs.Add(UploadHour);
            vs.Add(UploadDay);
            vs.Add((byte)UploadEnableFlag);
            vs.AddRange(Enumerable.Repeat<byte>(0,2));
        }
        /// <summary>
        /// 信号下限
        /// </summary>
        public byte CsqLimit { get; set; }
        /// <summary>
        /// 接收超时时间
        /// </summary>
        public byte ReceiveTimeout { get; set; }
        /// <summary>
        /// 发送超时时间
        /// </summary>
        public byte SendTimeout { get; set; }
        /// <summary>
        /// 重试次数
        /// </summary>
        public byte RetryCount { get; set; }
        /// <summary>
        /// 网络参数启用标识
        /// </summary>
        public ParamaterEnableFlag NetworkEnableFlag { get; set; }
        /// <summary>
        /// 主动上传周期分
        /// </summary>
        public byte UploadMinute { get; set; }
        /// <summary>
        /// 主动上传周期时
        /// </summary>
        public byte UploadHour { get; set; }
        /// <summary>
        /// 主动上传周期天
        /// </summary>
        public byte UploadDay { get; set; }
        /// <summary>
        /// 上传参数启用标识
        /// </summary>
        public ParamaterEnableFlag UploadEnableFlag { get; set; }

    }
}
